<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['设备安装管理','设备安装记录[复审]']" icon="fa fa-wrench" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设备安装记录[复审]</h2></header>
                <ul class="nav nav-tabs" id="myTab1" style="padding-left:12px;background-image: linear-gradient(#F1F5FD, #E9F0FF);padding: 0;">
                    <li class="active s-lis"><a data-toggle="tab" style="color: black !important;" href="" (click)="switchTabTop('2')">复审 <span></span></a></li>
                    <li class="s-lis"><a data-toggle="tab" style="color: black !important;" href="" (click)="switchTabTop('1')">初审明细 <span></span></a></li>
                </ul>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn" style="display: flex; flex-wrap: wrap">
                                <div class="top_module">
                                    <span class="module_text">公司名称</span>
                                    <sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
                                </div>
                                <div class="top_module">
                                    <span class="module_text">车牌号码</span>
                                    <div class="s_hover_box">
                                        <select   class="select2"  id="carNumberSelect2Second">
                                            <option value=''></option>
                                        </select>
                                        <div class="s_del_icon" (click)='delCarNumber()'>x</div>
                                    </div>
                                </div>
                                <div class="top_module top_module_box" style="min-width: auto;">
                                    <span class="top_module_label module_text">时间类型</span>
                                    <select name="" class="top_module_select" style="min-width: 110px;" [(ngModel)]="tableParam.dateType">
                                        <option value="1">审核时间</option>
                                        <option value="2">安装时间</option>
                                        <option value="3">创建时间</option>
                                    </select>
                                </div>
                                <div class="selectDate top_module">
                                    <div class="input-daterange input-group s_selected_time_box s_hover_box">
                                        <input type="text" [(ngModel)]='tableParam.startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
                                        <span class="s_selected_time_spe">至</span>
                                        <input type="text" [(ngModel)]='tableParam.endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
                                        <div class="s_del_icon" (click)='delDate()'>x</div>
                                    </div>
                                </div>
                                <div class="top_module top_module_box" style="min-width: auto;" *ngIf="tableParam.level === '1'">
                                    <span class="top_module_label module_text">初审是否正确</span>
                                    <select name="" class="top_module_select" style="min-width: 110px;" [(ngModel)]="tableParam.isCorrect">
                                        <option value="">全部</option>
                                        <option value="2">正确</option>
                                        <option value="3">错误</option>
                                        <option value="0">初审中</option>
                                        <option value="1">复审中</option>
                                    </select>
                                </div>
                                <div [hidden]="tableParam.level !== '1'">
                                    <div class="top_module">
                                        <span class="module_text">审核人员</span>
                                        <div class="s_hover_box">
                                            <select  class="select2" id="checkPerson">
                                                <option value=''></option>
                                            </select>
                                            <div class="s_del_icon" (click)='delPerson()'>x</div>
                                        </div>
                                    </div>
                                </div>

                                <button  type="button"  class="btn btn-primary" (click)="tableSearch()">查询</button>
                                <button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
                            </div>
                        </div>
                        <div class="" style="">
                            <ul class="nav nav-tabs" id="myTab" style="padding-left:12px;background-image: linear-gradient(#F1F5FD, #E9F0FF);padding: 0;">
                                <li class="active s-lis"><a data-toggle="tab" href="" (click)="switchTab('')">全部 <span></span></a></li>
                                <li class="s-lis"><a data-toggle="tab" href="" (click)="switchTab('0')">待审核 <span></span></a></li>
                                <li class="s-lis"><a data-toggle="tab" href="" (click)="switchTab('1')">审核通过 <span></span></a></li>
                                <li class="s-lis"><a data-toggle="tab" href="" (click)="switchTab('2')">审核不通过 <span></span></a></li>
                            </ul>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                <tr>
                                    <th *ngFor="let item of tableColumn" [hidden]="!((item.isShow && (tableParam.examineStatus === '1' || tableParam.examineStatus === '2')) || !item.isShow)">
                                        <span *ngIf="(item.isShow && (tableParam.examineStatus === '1' || tableParam.examineStatus === '2')) || !item.isShow">{{ item.label }}</span>
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr *ngFor="let row of tableData" >
                                    <td *ngFor="let item of tableColumn" [hidden]="!((item.isShow && (tableParam.examineStatus === '1' || tableParam.examineStatus === '2')) || !item.isShow)">
                                        <button type="button" (click)="getDetail(row, ImgModal)" *ngIf="item.type === 'button'">{{ tableParam.examineStatus === '0' || tableParam.examineStatus === ''  ? '图片' : '详情'}}</button>
                                        <span *ngIf="item.fun && ((item.isShow && (tableParam.examineStatus === '1' || tableParam.examineStatus === '2')) || !item.isShow)">{{ item.fun(row) }}</span>
                                        <span *ngIf="item.type === 'html'">
                                            <sa-sensor-type [sensorTypeId]="row.sensorType" type='2' [inputParam]="sensorType" [isSendRequest]='false'></sa-sensor-type>
                                        </span>
                                        <span *ngIf="!item.fun && item.isShow && (tableParam.examineStatus === '1' || tableParam.examineStatus === '2')">{{ row[item.key] }}</span>
                                        <span *ngIf="!item.fun && item.type !== 'html' && !item.isShow">{{ row[item.key] }}</span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCount"
                                       [rows]="pageSize"
                                       [currentPage]="curPage - 1"
                                       (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="load()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<section bsModal #ImgModal="bs-modal" (onHidden)="handleWindowHidden()" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 1200px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">安装审核</h4>
            </div>
            <div class="modal-body" style="padding: 0 20px 20px 20px">
                <sa-record-modal *ngIf="isShow"  [checkType]="'second'" [isDisable]="tableParam.level !== '2'" [deviceInstallExamine]="deviceInstallExamine" [car]="car" #recordModal (submitSuccess)="submitSuccess(ImgModal)"></sa-record-modal>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" (click)="cancelCheck(ImgModal)">取消</button>
                <button type="button" class="btn btn-primary" *ngIf="tableParam.level === '2'" (click)="submit()">提交</button>
            </div>
        </div>
    </div>
</section>